package com.wsc.wsckeeper.model;

import com.wsc.wsckeeper.activities.fragments.AccountsFragment;
import com.wsc.wsckeeper.activities.fragments.CardsFragment;
import com.wsc.wsckeeper.enums.Mode;
import com.wsc.wsckeeper.enums.OrderBy;
import com.wsc.wsckeeper.model.entity.AccountE;
import com.wsc.wsckeeper.model.entity.CardE;

public class KModel {

	private static KModel instance;
	private Mode mode;
	private CardE card;
	private Mode cardMode;
	private AccountE account;
	private Mode accountMode;
	private OrderBy order;
	
	public CardsFragment cardsFragment;
	public AccountsFragment accountsFragment;

	private KModel() {
	}

	public static KModel getInstance() {
		if (instance == null) {
			instance = new KModel();
		}
		return instance;
	}

	public void cleanData() {
		instance = null;
	}

	public Mode getMode() {
		return mode;
	}

	public void setMode(Mode mode) {
		this.mode = mode;
	}

	public CardE getCard() {
		return card;
	}

	public void setCard(CardE card) {
		this.card = card;
	}

	public Mode getCardMode() {
		return cardMode;
	}

	public void setCardMode(Mode cardMode) {
		this.cardMode = cardMode;
	}

	public AccountE getAccount() {
		return account;
	}

	public void setAccount(AccountE account) {
		this.account = account;
	}

	public Mode getAccountMode() {
		return accountMode;
	}

	public void setAccountMode(Mode accountMode) {
		this.accountMode = accountMode;
	}

	public OrderBy getOrder() {
		if (order == null)
			order = OrderBy.ASC;
		return order;
	}

	public void setOrder(OrderBy order) {
		this.order = order;
	}
}